feat(cpu): add SiLU implementation - #859
Open
voltjia wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Motivation
The torch-infini PrivateUse1 plugin needs InfiniOps to expose
Siluin CPU-only builds before it can register standardaten::siluwhile retaining its no-accelerator fallback. Without a CPU specialization, the generated public operator header omitsSilubecause no active CPU implementation exists. Adding the native CPU path makes the generated call surface available and keeps CPU fallback behavior consistent with accelerator builds.Type of Change
featthat adds a new platform implementation for an existing operator.Platforms Affected
Smoke Test Result
The exact commit
023f7fc15736464947281f0c638e6a319c7bdaa9was built inaccelerator-dev/nvidia:latestwithWITH_CPU=ON,AUTO_DETECT_DEVICES=OFF, andAUTO_DETECT_BACKENDS=OFFagainst a CPU-only install of InfiniRT95c70080f9551e61241110497d163dfcdf9dc7e7.SiLU is intentionally not part of the minimal smoke selection because it exercises the existing elementwise operator path. The unchanged CPU smoke suite contained no
test_silu.pycases and passed.The complete SiLU operator module also passed.
The modified C++ file passed clang-format.
Test Results on Supported Platforms
Benchmark / Performance Impact
No performance benchmark was run because this PR adds the missing correctness implementation and does not claim a performance improvement.
Notes for Reviewers
This PR is a prerequisite for registering standard
aten::siluin torch-infini without breaking CPU-only builds or CPU fallback execution.